package
{
	import flash.display.DisplayObject;
	import flash.events.EventDispatcher;
	import flash.ui.ContextMenu;
	import flash.ui.ContextMenuItem;
	import flash.utils.ByteArray;
	import flash.utils.ByteArrayAsset;
	
	import kpe.libraries.plugins.IHostFacade;
	import kpe.libraries.plugins.ISSGUIPlugin;
	
	import mx.collections.ArrayCollection;
	import mx.modules.ModuleBase;
	
	public class KPESocialAppPlugin extends ModuleBase implements ISSGUIPlugin
	{
		[Embed("plugin-config.xml", mimeType="application/octet-stream")]
		public static const Config:Class;
		
		private var _pluginName:String;
		private var _pluginId:String;
		private var _pluginConfig:XML;
		private var _pluginUID:String;
		private var _hostFacade:IHostFacade;
		
		public function KPESocialAppPlugin()
		{
			super();
			_pluginName = "KPE Social App";
			_pluginId = "KPESocialApp";
			_pluginConfig = loadPluginXML();
		}
		
		private function loadPluginXML():XML {
			var ba:ByteArrayAsset = ByteArrayAsset(new Config());
			var xml:XML = new XML (ba.readUTFBytes(ba.length));
			return xml;
		}
		
		public function get pluginName():String
		{
			return _pluginName;
		}
		
		public function get pluginId():String
		{
			return _pluginId;
		}
		
		public function get pluginUID():String
		{
			return _pluginUID;
		}
		
		public function get pluginVersion():String
		{
			return "0.0.1";
		}
		
		public function get pluginConfig():XML
		{
			return _pluginConfig;
		}
		
		public function set pluginUID(value:String):void
		{
			return _pluginUID;
		}
		
		public function getZUIObjectsForSSP(aSSPURI:String):Array
		{
			return null;
		}
		
		public function getGANTTItemsForSSP(aSSPURI:String):Array
		{
			return null;
		}
		
		public function get hostFacade():IHostFacade
		{
			return _hostFacade;
		}
		
		public function set hostFacade(aVal:IHostFacade):void
		{
			_hostFacade = aVal;
		}
		
		public function loadSSPContents(aSSPURI:String, aCompleteEventHandler:Function=null):EventDispatcher
		{
			return null;
		}
		
		public function getContextMenuItems_ContentViewPlane(aSSPURI:String, aContextMenu:ContextMenu):Array
		{
			return [new ContextMenuItem("testing", false, true, true)];
		}
		
		public function getLinkTypes():Array
		{
			return [{title:"some link", type:"someLink"}];
		}
		
		public function linkCreated(aStartObjectURI:String, aEndObjectURI:String, aLinkType:String):void
		{
		}
		
		public function setPluginContent(data:ArrayCollection):void
		{
		}
		
		public function getContent():DisplayObject
		{
			return null;
		}
		
		public function open(type:String=""):void
		{
		}
	}
}